package au.com.handsunited.utils.comparator;

import java.util.Comparator;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import au.com.handsunited.model.message.Message;

/**
 *
 * @author arunda
 */
public class MessagesSorter implements Comparator<Message> {


	private static Logger logger = LoggerFactory.getLogger(MessagesSorter.class);

	/**
	 *
	 */
	public MessagesSorter() {

	}

	/**
	 * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
	 */
	@Override
	public int compare(Message message1, Message message2) {
		return message2.getDateCreated().getDate().compareTo(message1.getDateCreated().getDate());
	}

}
